package com.qf.service.impl;

import com.qf.controller.AnnouncementController;
import com.qf.mapper.AnnouncementMapper;
import com.qf.pojo.Announcement;
import com.qf.service.AnnouncementService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AnnouncementServiceImpl implements AnnouncementService {

    @Autowired
    private AnnouncementMapper mapper;

    @Override
    public List<Announcement> findAll() {
        return mapper.selectByExample(null);
    }

    @Override
    public void deleteAll(Integer[] id) {
        mapper.deleteAll(id);
    }

    @Override
    public void deleteById(Integer id) {
        mapper.deleteByPrimaryKey(id);
    }

    @Override
    public void updateAnnouncemet(Announcement announcement) {
        mapper.updateByPrimaryKeySelective(announcement);
    }

    @Override
    public void addAnnouncement(Announcement announcement) {
        mapper.insertSelective(announcement);
    }


}
